#include "svgwidget.h"
#include <QWheelEvent>
SvgWidget::SvgWidget()
{
    render=renderer();
}

void SvgWidget::wheelEvent(QWheelEvent *event)
{
    const double diff=0.1; // (a)
    QSize size =render->defaultSize (); // (b)
    int width =size. width();
    int height =size.height();
    if (event->angleDelta().y() >0)
    {
        //对图片的长、宽值进行处理，放大一定的比例
        width =int (this->width () + this->width() *diff);
        height =int (this->height () + this->height () *diff);
    }else
    {
        width =int (this->width () - this->width() *diff);
        height =int (this->height () - this->height () *diff);
    }
    resize(width,height);
}
